package com.gzz.orchid.main.facade.openfeign;

import org.springframework.security.core.userdetails.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * 声明式HTTP接口（OpenFeign进化）
 *
 * @author higmd
 */
@HttpExchange(url = "/users", accept = "application/json")
public interface UserClient {
    @GetExchange("/{id}")
    User getUser(@PathVariable Long id);

    //
    @PostExchange
    User createUser(User user);
}
/// / 自动配置
//@Bean
//public UserClient userClient(WebClient.Builder builder) {
//    return HttpServiceProxyFactory
//            .builder(WebClientAdapter.forClient(builder.build()))
//            .build()
//            .createClient(UserClient.class);
//}